<?php /* Smarty version 2.6.26, created on 2011-01-25 16:46:15
         compiled from admin/submodules/cfilter.module.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'sslash', 'admin/submodules/cfilter.module.html', 42, false),array('modifier', 'escape', 'admin/submodules/cfilter.module.html', 42, false),)), $this); ?>

<script type="text/javascript">
<!--<?php echo '
$(document).ready
(
    function()
    {
	$(\'select#filter\').change
	(
	    function()
	    {
		$.blockUI({message:\'Подождите...\'});
		setTimeout(function(){$.unblockUI()},2000);
	    }
	);

	$(\'input#customer-name\').autocomplete
	({
	    source:	\'json/getDictionary.php?dictionary=customers\',
	    delay:	0,
	    select:	function(event,ui){$(this).val($(ui.item).val());$(\'form#customer-search\').submit();}
	});

	$(\'input:checkbox.search-option\').click(function(){$(\'form#customer-search\').submit();});
	$(\'select#filter-print\').change(function(){$(\'form#customer-search\').submit();});
	$(\'a#q-clean\').click(function(){$(\'#customer-name\').val(\'\');});
    }
);
'; ?>
-->
</script>

<!-- НАЧАЛО блока фильтров -->
<form method="get" id="customer-search">
    <input type="hidden" name="do" value="filter"/>
    <table class="ui-widget ui-state-default ui-corner-all" >
	<tr>
	    <th class="ui-widget-header" colspan="4">Блок фильтров</th>
	</tr>
	<tr>
	    <td align="right">Поиск:</td>
	    <td colspan="2"><input type="text" name="q" class="search" value="<?php echo ((is_array($_tmp=((is_array($_tmp=$_SESSION['filter']['customer_list']['q'])) ? $this->_run_mod_handler('sslash', true, $_tmp) : stripslashes($_tmp)))) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" id="customer-name" style="width: 95%;"/><a href="javascript:void(0)" id="q-clean"><img src="images/icons/delete_16.png" border="0"/></a></td>
	</tr>
	<tr>
	    <td align="right">Номер договора:</td>
	    <td><input type="text" name="contract_num" class="search" value="<?php echo ((is_array($_tmp=((is_array($_tmp=$_SESSION['filter']['customer_list']['contract_num'])) ? $this->_run_mod_handler('sslash', true, $_tmp) : stripslashes($_tmp)))) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" id="contract-num" style="width: 90%;"/><a href="javascript:void(0)" id="contract-clean"><img src="images/icons/delete_16.png" border="0"/></a></td>
	    <td>&nbsp;</td>
	</tr>
	<?php if ($_SESSION['manager']['is_admin'] == 1): ?>
	<tr>
	    <td align="right">Менеджер:</td>
	    <td colspan="2">
		<select name="manager_id">
		    <option value="">&mdash;</option>
		    <?php $_from = $this->_tpl_vars['managers']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['manager']):
?>
		    <option value="<?php echo $this->_tpl_vars['manager']['id']; ?>
" <?php if ($_SESSION['filter']['customer_list']['manager_id'] == $this->_tpl_vars['manager']['id']): ?>selected<?php endif; ?>><?php echo $this->_tpl_vars['manager']['manager_name']; ?>
</option>
		    <?php endforeach; endif; unset($_from); ?>
		</select>
	    </td>
	</tr>
	<?php endif; ?>
	<tr>
	    <td align="right">Группа:</td>
	    <td colspan="2">
		<select name="group_id">
		    <option value="">&mdash;</option>
		    <?php $_from = $this->_tpl_vars['groups']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['group']):
?>
		    <option value="<?php echo $this->_tpl_vars['group']['id']; ?>
" <?php if ($_SESSION['filter']['customer_list']['group_id'] == $this->_tpl_vars['group']['id']): ?>selected<?php endif; ?>><?php echo $this->_tpl_vars['group']['group_name']; ?>
</option>
		    <?php endforeach; endif; unset($_from); ?>
		</select>
	    </td>
	</tr>
	<tr>
	    <td align="right">Статус:</td>
	    <td>
		<select name="status_id">
		    <option value="">&mdash;</option>
		    <?php $_from = $this->_tpl_vars['statuss']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['status']):
?>
		    <option value="<?php echo $this->_tpl_vars['status']['id']; ?>
" <?php if ($_SESSION['filter']['customer_list']['status_id'] == $this->_tpl_vars['status']['id']): ?>selected<?php endif; ?>><?php echo $this->_tpl_vars['status']['status_name']; ?>
</option>
		    <?php endforeach; endif; unset($_from); ?>
		</select>
	    </td>
	    <td>
		<select name="documents" id="filter-print">
		    <option value="">&mdash;</option>
		    <option value="complete" <?php if ($_SESSION['filter']['customer_list']['documents'] == 'complete'): ?>selected<?php endif; ?> class="ui-state-highlight">Документы загружены</option>
		    <option value="no-complete" <?php if ($_SESSION['filter']['customer_list']['documents'] == 'no-complete'): ?>selected<?php endif; ?> class="ui-state-error">Документы не загружены</option>
		    <option value="printed" <?php if ($_SESSION['filter']['customer_list']['documents'] == 'printed'): ?>selected<?php endif; ?> class="ui-state-default">Документы распечатаны</option>
		    <option value="no-printed" <?php if ($_SESSION['filter']['customer_list']['documents'] == 'no-printed'): ?>selected<?php endif; ?> class="ui-state-disabled">Документы не распечатаны</option>
		</select>
	    </td>
	</tr>
	<tr>
	    <td colspan="3" align="center">
		<input type="submit" class="button" value="Применить фильтр"/>
	    </td>
	</tr>
    </table>
</form>
<!-- КОНЕЦ блока фильтров -->